<template>
	<view class="uni-tab-bar">
		<scroll-view class="uni-swiper-tab" scroll-x>
			<block v-for="(value,key) in functabBars" :key="key" :style="scrollStyle">
				<view class="swiper-tab-list" :class="{'active' : funcIndexbar==key}" @click="functabtap(key,value.route)" :style="scrollItemStyle">
					{{value.name}}{{value.num?value.num:""}}
					<view class="func-tab-short">{{value.route.title}}</view>
					<view class="swiper-tab-line"></view>
				</view>
			</block>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		props:{
			functabBars:Array,
			funcIndexbar:Number,
			scrollStyle:{
				type:String,
				default:""
			},
			scrollItemStyle:{
				type:String,
				default:""
			}
		},
		methods:{
			//点击切换导航
			functabtap(index,route){
				this.$emit('functabtap',index,route);
			},
			goodslist_more(){
				console.log("更多商品");
				//监听搜索框点击事件
				uni.navigateTo({
					url: `/pages/category/category`
				})
			},
			onPageScroll: function(Object) { 
				console.log(Object.scrollTop);//实时获取到滚动的值 
			}
		}
	}
</script>

<style scoped>
	.uni-swiper-tab{
		width:100%;
		height:120upx;
	}
	
	.uni-tab-images{
		width:90upx;
		height:90upx;
		position:absolute;
		right:0;
	}
	.uni-tab-images image{
		width: 90upx;
	}
	.func-tab-short{
		font-weight:normal;
		font-size:25upx;
		color:#909090;
	}
	.swiper-tab-list{
		width:25%;
		color: #000000;
		font-weight: bold;
	}
	.uni-tab-bar .active{
		color: #F76260;
		font-size:35upx;
	}
	.active .swiper-tab-line{
		border-bottom: 6upx solid #FEDE33;
		width: 70upx;
		margin: auto;
		border-top: 6upx solid #FEDE33;
		border-radius: 20upx;
	}
	/* #ifdef H5 */
		.uni-tab-bar::-webkit-scrollbar{
			width: 0;
			height: 0;
			color: transparent;
		}
		.uni-tab-bar::-webkit-scrollbar {
			width: 0px;
			display: none;
		}
		
		.uni-tab-bar::-webkit-scrollbar-track {
			background-color: none;
		}
		
		.uni-tab-bar::-webkit-scrollbar-thumb {
			background-color: none;
		}
		
		.uni-tab-bar::-webkit-scrollbar-thumb:hover {
			background-color: none;
		}
		
		.uni-tab-bar::-webkit-scrollbar-thumb:active {
			background-color: none;
		}
	/* #endif */
</style>
